#include <iostream>
#include <cstring>
int add(int a, int b, int c = 0);
bool func(int a, char *errorMsg = NULL)
{
    if (errorMsg != NULL)
    {
        strncpy(errorMsg, "connect error\n", strlen("connect error\n"));
        return false;
    }
    return true;
}
int add(int a, int b, int c)
{
    return a + b + c;
}
/*占位参数(运算符重载再讲todo...)*/
int add_01(int a, int b, int)
{
    return a + b;
}
int main()
{
    char msg[1024] = {0};
#if 0
    if (func(1, msg) == false)
    {
        std::cout << msg;
    }
#endif
    func(1);
    std::cout << add(10, 20) << std::endl;
    std::cout << add_01(10, 20, 30) << std::endl;
    return 0;
}